package com.easy.service;

import com.easy.bean.User;
import com.easy.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class EasyService {
    @Autowired
    UserDao userD;
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void easy(){
        User user=new User();
        user.setUsername("easy");
        userD.add(user);
//        int a=12/0;
    }
}
